package com.itcast.StringBuilder.Demo01;

/*
要写注释哦!!!
*/
public class Test2 {
    public static void main(String[] args) {
        StringBuilder stringBuilder1 = new StringBuilder();
        //添加内容
        StringBuilder zzz = stringBuilder1.append("zzz");
        StringBuilder aaa = stringBuilder1.append("aaa");
        StringBuilder fff = stringBuilder1.append("fff");
        System.out.println(fff);
        System.out.println(stringBuilder1);
        //翻转
        StringBuilder reverse = stringBuilder1.reverse();
        System.out.println(reverse);
        StringBuilder stringBuilder2 = new StringBuilder();
        stringBuilder2.append("rrr");
        stringBuilder2.append("kkk");
        //判断两个字符序列地址是否一样
        boolean equals = stringBuilder1.equals(stringBuilder2);
        System.out.println(equals);

        //获取字符序列的长度
        System.out.println(stringBuilder1.length());

        //把字符序列转为字符串
        String string = stringBuilder2.toString();
        System.out.println(string);
    }
}
